#pragma once

#include "CameraController.hpp"
#include "EncoderManager.hpp"
#include "FileStorageManager.hpp"
#include "NetworkTransmitter.hpp"
#include "TransmitterManager.hpp"
#include "camera_manage_type.h"
#include "camera_type.h"
#include <map>
#include <memory>
#include <vector>
class CameraManager {
  public:
    CameraManager();
    ~CameraManager();

    void initialize(const MultiCameraConfig &configFile);
    void start();
    void stop();
    void setSaveFileDir();
    bool setStoreConfig(const CameraStoreOpt_t &config);
    bool setCameraConfig(const CameraConf_t &config);
    bool setCameraTranConfig(const CameraTranConf_t &config);

  private:
    std::unique_ptr<CameraController> m_cameraController;
    std::unique_ptr<EncoderManager> m_encoderManager;
    std::unique_ptr<TransmitterManager> m_transmitterManager;
    MultiCameraConfig m_cameraConfig = {};
    std::vector<std::unique_ptr<FileStorageManager>> m_fileStorageManagers;
    void processFrame(int cameraId, const CbbCameraFrame_t &frame);
    bool saveConfig();
};